package fr.mma.livraison;

import java.io.IOException;

import javax.servlet.ServletException;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

import fr.mma.livraison.dao.AdminDao;

@SuppressWarnings("serial")
public class IndexServlet extends HttpServlet {

	final static protected AdminDao dao = new AdminDao();

	public void doGet(final HttpServletRequest req, final HttpServletResponse resp) throws IOException {
		try {
			String userAgent = req.getHeader("User-Agent");
			if(userAgent.contains("Mobile")) {
				req.getRequestDispatcher("/mobile").forward(req, resp);	
			} else {
				req.getRequestDispatcher("/start.html").forward(req, resp);
			}
		} catch (ServletException e) {
			e.printStackTrace();
		}

	}
}
